#include<iostream> 
#include<cmath> 
using namespace std;
 
class complex
{
private:
        double real;
        double imag;
public:
       complex (double r=0.0 ,double i=0.0) 
       {real=r;imag=i;} 
       complex (complex &c) 
       {real=c.real;imag=c.imag;}
   
       double realcomplex()   {return real;} 
       double imagcomplex()   {return imag;} 
       double abscomplex()    {return sqrt(real*real+imag*imag);} 
} ; 


int main()
{
    complex a(1.1,2.2);
    cout<<"real:" <<a.realcomplex()<<endl;
    cout<<"image:" <<a.imagcomplex()<<endl;
    cout<<"abs:"<<a.abscomplex()<<endl;
    complex b(a) ;
    cout<<"real:" <<b.realcomplex()<<endl;
    cout<<"image:" << b.imagcomplex()<<endl; 
    cout<<"abs:" <<b.abscomplex()<<endl; 
    system("pause") ;
    return 0; 
} 
